var path = $("#path").val();
function selectAll() {
    //获取文本框内容
    var name = document.getElementById("searchName").value;

    //获取下拉框的内容
    var typeId = document.getElementById("phoneType").value;

    window.location=path+'/phone/list?name='+name+"&typeId="+typeId;
}
function changeType(obj){//obj -> select对象
    var typeId = obj.value;//选中的option的value
    //发送到后台
    window.location=path+'/phone/list?typeId='+typeId;
}
function delAny() {
    var cks = document.getElementsByName("cks");
    var count = 0;
    for (var i =0;i<cks.length;i++){
        if (cks[i].checked){
            count++;
        }
    }
    if (count==0){
        alert("请先选择");
        return;
    }
    var pids = "";
    for (var i=0;i<cks.length;i++){
        if (cks[i].checked){
            pids+="id="+cks[i].value+"&";
        }
    }
    var url = path+'/phone/del/any?'+pids;
    window.location=url.substring(0,url.length-1);
}
function insertAny(){
    // alert("aa");
    window.location=path+'/phone/insert';
}
// function insertOne(){
//     var name = document.getElementById("name").value;
//     var price = document.getElementById("price").value;
//     var free = document.getElementById("free").value;
//     var intro = document.getElementById("intro").value;
//     var type_id = document.getElementById("type_id").value;
//     var url = document.getElementById("url").value;
//     var status = document.getElementById("status").value;
//
//     window.location='/servlet-demo/phone/insert?name';
//     alert("添加成功");
// }

